Skip to content

RM-255: Re-enable force-disabled panels#36

Merged
BenHall-1 merged 2 commits into
masterfrom
RM-255
Apr 26, 2026
Merged

RM-255: Re-enable force-disabled panels#36
BenHall-1 merged 2 commits into
masterfrom
RM-255

Conversation

@biast12

@biast12 biast12 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Renamed PanelTable.DisableSome to ForceDisableSome and clarified SQL formatting. The function now enforces the freeLimit by disabling excess panels (newest first) and, if there are too few enabled panels, re-enabling previously force-disabled panels (oldest first). Uses pgtype.Int4Array to pass ID arrays to UPDATE queries and adds clearer comments to explain behavior.
Simplify panel enable/disable logic by using single UPDATE statements with subqueries instead of selecting IDs, building arrays, and issuing separate updates. Adds a deferred tx.Rollback(ctx) and consolidates the COUNT query. The changes preserve ordering (disable newest first with DESC, re-enable oldest first with ASC) and reduce round-trips / avoid pgtype.Int4Array handling.
@BenHall-1 BenHall-1 merged commit 8e5afd0 into master Apr 26, 2026
@BenHall-1 BenHall-1 deleted the RM-255 branch April 26, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants